package cn.waka.sys.admin.object;

import java.util.LinkedList;
import java.util.List;

import org.springframework.data.annotation.TypeAlias;

@TypeAlias("Menu")
public class Menu {
    private int id;
    private String title;
    private String url;
    private String icon;
    private String target;
    private boolean status;
    private List<Menu> children;
    private int nodeId;
    private Node node = new Node();
    private int pid;
    private int sort;
    private String key;


    public int getNodeId() {
        return nodeId;
    }

    public void setNodeId(int nodeId) {
        this.nodeId = nodeId;
    }


    public int getSort() {
        return sort;
    }

    public Node getNode() {
        return node;
    }

    public void setNode(Node node) {
        this.node = node;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public void add(Menu child) {
        if (children == null) {
            children = new LinkedList<Menu>();
        }
        children.add(child);
    }

    public List<Menu> getChildren() {
        return children;
    }

    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }


    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    @Override
    public String toString() {
        return "Menu [id=" + id + ", title=" + title + ", url=" + url + ", icon=" + icon + ", target=" + target
                + ", status=" + status + ", node=" + node + ", pid=" + pid + ", sort=" + sort + "]";
    }


}
